#ifndef CLASSROOMCOMPUTERSETTINGS_H
#define CLASSROOMCOMPUTERSETTINGS_H
#include "global.h"
QT_BEGIN_NAMESPACE
namespace Ui { class ClassroomComputerSettings; }
QT_END_NAMESPACE
class ClassroomComputerSettings : public QMainWindow
{
	Q_OBJECT
public:
	ClassroomComputerSettings(QWidget *parent = nullptr);
	~ClassroomComputerSettings();
	void loadConfig();
private slots:
	void on_longTermTimetableTable_cellClicked(int row, int column);
	void on_subjectListWidget_2_itemClicked(QListWidgetItem *item);
	void on_subjectListWidget_itemClicked(QListWidgetItem *item);
	void on_addClassBtn_clicked();
	void on_removeClassBtn_clicked();
	void on_TempTimetableTable_cellClicked(int row, int column);
	void on_tabWidget_currentChanged(int index);
	void on_hiddenSubjectsListWidget_itemClicked(QListWidgetItem *item);
	void on_deleteTempScheduleBtn_clicked();
	void on_daySelectorComboBox_currentIndexChanged(int dayOfWeek);
	void on_restoreDefaultsAction_triggered();
	void on_save_triggered();
	void on_doNotSave_triggered();
	void on_openWebsite_triggered();
	void on_about_triggered();
private:
	void loadTempTimetable(int mday = -1);
	void showErrorMessage(const QString &message);
	bool isSettingError = 0;
	bool m_doNotSave = false;
	int currentRow = -1;
	Ui::ClassroomComputerSettings *ui;
protected:
	void closeEvent(QCloseEvent *event) override
	{
		if (m_doNotSave) {
			m_doNotSave = false;
			event->accept();
			return;
		}
		on_save_triggered();
		if (isSettingError) event->ignore();
		else event->accept();
	}
};
#endif
